package message.mq.consumer;

import message.pojo.Demo;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * .
 *
 * @author <a href="mailto:sunhao.java@gmail.com">sunhao(sunhao.java@gmail.com)</a>
 * @date 2018-08-02 16:07
 */
@Component
@RabbitListener(queues = "queue2")
public class TestReceiver2 {
    @RabbitHandler
    public void receive2(List<Demo> demos) {
        System.out.println("监听准备[receive2]：");
        System.out.println("get demo is: " + demos);
        System.out.println("get demo one name is : " + demos.get(0).getName());
    }
}
